﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CodeFirstStoredProcs;
using VietTrips.Domain.Models;


namespace VietTrips.Domain.Contexts
{
    public class SearchContext : DbContext
    {
        //[StoredProcAttributes.Name("Search")]
        //[StoredProcAttributes.ReturnTypes(typeof(ResultSearch))]
        public StoredProc<Search> SearchProc { get; set; }
        public DbSet<ResultSearch> SearchDetail { get; set; } 

        public SearchContext()
            : base("DefaultConnection")
        {
            // Must be called prior to using any stored proc objects
            this.InitializeStoredProcs();
            SearchProc.HasName("SearchFunc")
                .HasOwner("dbo")
                .ReturnsTypes(typeof(ResultSearch));
           
        }
       
    }

}
